﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace MyFace
{
    static class TextReader
    {
        static public string TXTFile = "portugues.txt";
        static public StreamReader SR = new StreamReader(@"Content/Idiomas/portugues.txt");
        static public List<string> lines = new List<string>();
        
        static string test; 

        static public List<string> ChangeLanguage(string lang)
        {
            TXTFile = lang+".txt";
            try
            {
                SR = new StreamReader(@"Content/Idiomas/" + TXTFile);
            }
            catch
            {
                lang = "portugues.txt";
                SR = new StreamReader(@"Content/Idiomas/" + TXTFile);
            }
            return LoadAll();
        }

        static public List<string> LoadAll()
        {
            lines = new List<string>();
            int count = 0;
            while (!SR.EndOfStream)
            {                
                test = SR.ReadLine();
                Console.WriteLine(count + ", " + test);
                lines.Add(test);
                count++;
            }
            return lines;
        }
    }
}
